import React from 'react';
import { Input, Button, Icon, Card } from 'antd';
import PropTypes from 'prop-types'
import { Link } from 'dva/router';
import { connect } from 'dva';

const Search = Input.Search;

class ArticleDetail extends React.Component {
    constructor(props) {
        super(props);

    }
    render() {
        const { title, content } = this.props.article;
        if(title=='')
        {
            return null;
        }
        return (
            <div style={{ width: 1024 }}>
                <Card>
                    <p className="title" style={{ fontSize: '18px' }}>
                        {title}
                        <Link to={'/add'}> <Button type="primary" style={{ float: 'right' }} icon="plus-circle-o" ghost>我要提问</Button></Link>
                    </p>
                    <div className="questioncontent">
                        <div className="leftcontent">
                            <p><Icon type="caret-up" /></p>

                            <p>0</p>
                            <p> <Icon type="caret-down" /></p>

                            <p><Icon type="star-o" /></p>
                        </div>
                        <div className="rightcontent">
                            <div className="contentinfo" dangerouslySetInnerHTML={{ __html: content }}>
                            </div>
                        </div>
                        <div style={{ clear: 'both' }} />

                    </div>
                    <div style={{ width: 256, float: 'left' }}>

                    </div>
                </Card>
            </div>
        )
    }
}
ArticleDetail.propTypes = {
    dispatch: PropTypes.func,
    article: PropTypes.object
}
export default connect(({ article }) => ({ article }))(ArticleDetail);